home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2000 July / CD 3 / redhat-6.2.iso / RedHat / instimage / usr / lib / anaconda / iw / welcome.py < prev    next >
Encoding:
Python Source  |  2000-03-08  |  2.5 KB  |  104 lines

  1. from gtk import *
  2. from gnome.ui import *
  3. from iw import *
  4. from translate import _
  5.  
  6. class WelcomeWindow (InstallWindow):        
  7.  
  8.     def __init__ (self, ics):
  9.     InstallWindow.__init__ (self, ics)
  10.  
  11.         ics.setTitle (_("Welcome"))
  12.         ics.setNextEnabled (1)
  13.         ics.readHTML ("wel")
  14.         self.ics = ics
  15.  
  16.     def getScreen (self):
  17.         frame = GtkFrame ()
  18.         frame.set_shadow_type (SHADOW_IN)
  19.         im = self.ics.readPixmap ("splash.png")
  20.         
  21.         if im:
  22.             im.render ()
  23.             box = GtkEventBox ()
  24.             pix = im.make_pixmap ()
  25.             style = box.get_style ().copy ()
  26.             style.bg[STATE_NORMAL] = style.white
  27.             box.set_style (style)
  28.             box.add (pix)
  29.             frame.add (box)
  30.  
  31.         return frame
  32.  
  33. class ReconfigWelcomeWindow (InstallWindow):        
  34.  
  35.     def __init__ (self, ics):
  36.     InstallWindow.__init__ (self, ics)
  37.  
  38.         ics.setTitle (_("Welcome"))
  39.         ics.setNextEnabled (1)
  40.         ics.readHTML ("welreconfig")
  41.         ics.setGrabNext (1)
  42.     self.beingDisplayed = 0
  43.         self.ics = ics
  44.  
  45.     def getNext (self):
  46.         if not self.beingDisplayed: return
  47.  
  48.         if self.cancelChoice.get_active():
  49.             import sys
  50.  
  51.             print "Exitting"
  52.             self.ics.ii.finishedTODO.set()
  53.             sys.exit(0)
  54.         else:
  55.             self.beingDisplay = 0
  56.             return None
  57.  
  58.     def getScreen (self):
  59.  
  60.  
  61.     frame = GtkFrame ()
  62.         frame.set_shadow_type (SHADOW_IN)
  63.  
  64.         box = GtkVBox (FALSE)
  65.         box.set_border_width (5)
  66.         frame.add (box)
  67.  
  68.         im = self.ics.readPixmap ("first-375.png")
  69.         
  70.         if im:
  71.             im.render ()
  72.             ebox = GtkEventBox ()
  73.             pix = im.make_pixmap ()
  74.             style = ebox.get_style ().copy ()
  75.             style.bg[STATE_NORMAL] = style.white
  76.             ebox.set_style (style)
  77.             ebox.add (pix)
  78.             box.pack_start (ebox, FALSE)
  79.  
  80.         label = GtkLabel(_("Would you like to configure your system?"))
  81.     label.set_line_wrap(TRUE)
  82.     label.set_alignment(0.0, 0.0)
  83.     label.set_usize(400, -1)
  84.  
  85.         box.pack_start(label)
  86.         
  87.         radioBox = GtkVBox (FALSE)
  88.     self.continueChoice = GtkRadioButton (None, _("Yes"))
  89.     radioBox.pack_start(self.continueChoice, FALSE)
  90.     self.cancelChoice = GtkRadioButton(
  91.         self.continueChoice, _("No"))
  92.     radioBox.pack_start(self.cancelChoice, FALSE)
  93.  
  94.     align = GtkAlignment()
  95.     align.add(radioBox)
  96.     align.set(0.5, 0.5, 0.0, 0.0)
  97.  
  98.     box.pack_start(align, TRUE, TRUE)
  99.     box.set_border_width (5)
  100.     self.beingDisplayed = 1
  101.  
  102.     return frame
  103.     
  104.